<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use app\xt\Auth;

// 后台登录
Route::get('/admin/login', 'backend/login/index');
Route::post('/admin/login', 'backend/login/postLogin');

//检测登录
$auth = Auth::getInstance();
if ($auth->check()) {
    // 后台
    Route::get('/admin', 'backend/index/index');

    // 后台登录
    Route::get('/admin/logout', 'backend/login/logout');

    // 标签
    Route::get('/admin/tag/index', 'backend/tag/index');
    Route::get('/admin/tag/create', 'backend/tag/create');
    Route::post('/admin/tag/create', 'backend/tag/save');
    Route::get('/admin/tag/:id/edit', 'backend/tag/edit');
    Route::post('/admin/tag/:id/edit', 'backend/tag/update');
    Route::get('/admin/tag/:id/delete', 'backend/tag/delete');

    // 贴子
    Route::get('/admin/post/index', 'backend/post/index');
    Route::get('/admin/post/create', 'backend/post/create');
    Route::post('/admin/post/create', 'backend/post/save');
    Route::get('/admin/post/:id/edit', 'backend/post/edit');
    Route::post('/admin/post/:id/edit', 'backend/post/update');
    Route::get('/admin/post/:id/delete', 'backend/post/delete');

    // 评论管理
    Route::get('/admin/post/comment/index', 'backend/comment/index');
    Route::get('/admin/post/comment/:id/delete', 'backend/comment/delete');
    Route::get('/admin/post/comment/:id/check', 'backend/comment/check');

    // 配置
    Route::get('/admin/setting', 'backend/setting/index');
    Route::post('/admin/setting', 'backend/setting/save');

    // 修改密码
    Route::get('/admin/account', 'backend/account/index');
    Route::post('/admin/account', 'backend/account/save');

}



return [

];
